package com.wsx.ones.boots.akka;

import akka.actor.Extension;
import akka.actor.Props;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * Created by wangshuaixin on 18/6/15.
 */
@Component
public class SpringExtension implements Extension {

    private ApplicationContext applicationContext;

    public void init(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }

    public Props prop(String actorName) {
        return Props.create(SpringActorProducer.class, applicationContext, actorName);
    }

    public Props prop(String actorName, Object... args) {
        return Props.create(SpringActorProducer.class, applicationContext, actorName, args);
    }

}
